fix(deploy): guard associative-array lookup so extension sync can't abort deploy.sh - #39
Draft
yulonglin wants to merge 1 commit into
Draft
fix(deploy): guard associative-array lookup so extension sync can't abort deploy.sh#39yulonglin wants to merge 1 commit into
yulonglin wants to merge 1 commit into
Conversation
…bort deploy.sh Under `set -euo pipefail` (deploy.sh line 15), zsh treats reading a missing associative-array key as a fatal error that terminates the shell outright — it is not a normal non-zero exit, so the `|| log_warning` guard on the deploy_editor_settings call cannot catch it. Any installed editor extension absent from config/vscode_extensions.txt therefore killed deploy.sh at the extension-sync step (~line 381 of 1340), silently skipping every later component: developer config files, Finicky, Ghostty, Zed, gitui, Claude, Codex, Serena, Mouseless, Alfred, text replacements, and all launchd/cron jobs. Add the `:-` default so a missing key reads as empty. wanted_map was the only associative array in the repo read with a possibly-absent key; the other three (SSH_THEME_OVERRIDES, pids, git_settings) only read keys they iterate. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
install_editor_extensions(scripts/shared/helpers.sh) readwanted_map[${ext:l}]without a:-default. Underset -euo pipefail(deploy.sh line 15), zsh treats reading a missing associative-array key as a fatal, uncatchable error — not a normal non-zero exit.config/vscode_extensions.txttriggered this, killingdeploy.shat the editor-settings step (~line 381 of 1340). The|| log_warning "Editor settings deployment failed"guard could not catch it, so the failure was silent — everything after that line (Finicky, Ghostty, Zed, gitui, Claude, Codex, Serena, Mouseless, Alfred repair, text replacements, all launchd/cron jobs) was skipped without any error message.:-default so a missing key reads as empty, matching the intended "not in wanted list → mark for removal" logic.SSH_THEME_OVERRIDES,pids,git_settings) — none have the same issue since they only read keys they iterate from the array's own key list.Test plan
zsh -c 'set -euo pipefail; typeset -A m; m[foo]=1; for e in FOO BAR; do [[ -z "${m[${e:l}]}" ]] && echo miss; done; echo END'dies before printing END.:--guarded form reaches the end under the sameset -euo pipefail../deploy.sh --editorend-to-end on a machine with an unlisted Cursor/VSCode extension installed, confirm it now completes deployment past the editor-settings step.